<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://www.ufida.com/lfw" prefix="lfw" %>
<%@ taglib uri="http://www.ufida.com/uif" prefix="uif" %> 
<%@ taglib uri="http://www.ufida.com/multilang" prefix="ml" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<html>
	<head>
		<lfw:base/>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<uif:import/>
		<script type='text/javascript' src='<%= "code/" + request.getParameter("pageId")%>'></script>
		<script type='text/javascript' src='${ROOT_PATH}/html/nodes/mainpage/lfwmain.js'></script>
		<script language="javascript">
		</script>
	</head>
	<body bottommargin="0" topmargin="0" leftmargin="0" rightmargin="0" scroll=no onload="pageBodyScript()">
		<table width="100%" height="100%" border="1" cellpadding="0" cellspacing="0">
			<tr>
				<lfw:pageModel className="nc.lfw.core.model.ConfigurationPageModel">
					<lfw:layout type="flowv">
					    <lfw:layoutPanel>
					    	<lfw:layout type="flowh">
					    		<lfw:layoutPanel width="80" height="50" align="right">
					    			<lfw:label id="oldpwd_label"/>
					    		</lfw:layoutPanel>
						        <lfw:layoutPanel>
					    			<lfw:textcomp id="oldpwd"/>
					    		</lfw:layoutPanel>
					    	</lfw:layout>
					    </lfw:layoutPanel>
					    <lfw:layoutPanel>
					    	<lfw:layout type="flowh">
					    		<lfw:layoutPanel  width="80" height="50" align="right">
					    			<lfw:label id="newpwd_label"/>
					    		</lfw:layoutPanel>
						        <lfw:layoutPanel>
					    			<lfw:textcomp id="newpwd"/>
					    		</lfw:layoutPanel>
					    	</lfw:layout>
					    </lfw:layoutPanel>
					    <lfw:layoutPanel>
					    	<lfw:layout type="flowh">
					    		<lfw:layoutPanel width="80" height="50" align="right">
					    			<lfw:label id="newpwdagain_label"/>
					    		</lfw:layoutPanel>
						        <lfw:layoutPanel>
					    			<lfw:textcomp id="newpwdagain"/>
					    		</lfw:layoutPanel>
					    	</lfw:layout>
					    </lfw:layoutPanel>
					 	<lfw:layoutPanel>
					 		<lfw:layout type="flowh">
						        <lfw:layoutPanel>
						    			<lfw:button id="modifypwd_okbt_id"/>
						    	</lfw:layoutPanel>
						    	<lfw:layoutPanel>
						    			<lfw:button id="modifypwd_cancelbt_id"/>
						 		</lfw:layoutPanel>
					 		</lfw:layout>
		 				</lfw:layoutPanel>
					
					</lfw:layout>>
				</lfw:pageModel>
			</tr>
		</table>
	</body>
</html>	
<script language="JavaScript">
	function ok()
	{
		var oldpwd = getComponent("oldpwd").getValue();
		var newpwd = getComponent("newpwd").getValue();
		var newpwdagain = getComponent("newpwdagain").getValue();
		if(newpwd != newpwdagain){
			showMessageDialog("${ml:trans('yer_psw001')}");
			getComponent("newpwd").setValue('');
			getComponent("newpwdagain").setValue('');
			return ;
		}
		if((oldpwd == newpwd) || (oldpwd == newpwdagain)){
			showMessageDialog("${ml:trans('yer_psw002')}");
			getComponent("newpwd").setValue('');
			getComponent("newpwdagain").setValue('');
			return ;
		}
		
		var param = 'oldpwd=' + oldpwd + '&newpwd=' + newpwd + '&newpwdagain=' + newpwdagain;
		var cmd = new CommonCommand('modifyPWD');
		cmd.setAsync(true);
		cmd.setParameter(param);
		cmd.setReturnFunc(returnFucForJuage);
		cmd.exec();
	   	//processCommonLogic(param, "modifyPWD", returnFucForJuage, null, true, null, null);
	   	function returnFucForJuage(result, returnArgs, success)
	   	{	
	   		if(success == true){
	   			if(result != 'success')
   					showMessageDialog(result);
   				else
   				{
   					parent.showMessageDialog("${ml:trans('yer_psw003')}");
   					cancel();
   				}	
	   		}
	   		else
		   		showMessageDialog("${ml:trans('yer_psw004')}");
	   	}
	}
	
	function cancel()
	{
		parent.hideDialog('modifypwd',false);
	}
</script>